import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
# 对processed_oil异常值检验
# 读取CSV文件
df = pd.read_csv('oil.csv')

# 检查dcoilwtico列是否有负值
dcoilwtico_negative = df[df['dcoilwtico'] < 0]

# 输出异常值
if not dcoilwtico_negative.empty:
    print("sales列中存在负值，异常值如下：")
    print(sales_negative)
# 创建箱线图
plt.figure(figsize=(10, 6))
sns.boxplot(x='dcoilwtico', data=df)
plt.title('Boxplot of dcoilwtico')
plt.show()